home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10654 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.nodak.edu!plains!jengel
  2. From: jengel@plains.nodak.edu (John H. Engel)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help with derived class of ifstream class
  5. Date: 9 Mar 1996 02:37:41 GMT
  6. Organization: North Dakota Higher Education Computing Network (NDHECN)
  7. Message-ID: <4hqqtl$871@daily-planet.nodak.edu>
  8. References: <4hob5n$65c@daily-planet.nodak.edu> <486.6641T879T944@panix.com>
  9. NNTP-Posting-Host: plains.nodak.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=US-ASCII
  12. Content-Transfer-Encoding: 7bit
  13. X-Newsreader: TIN [version 1.2 PL2]
  14.  
  15. Dae Choi (gugu@panix.com) wrote:
  16. : Hi,
  17.  
  18. : >#include <iostream.h>
  19.  
  20. : Perhaps you forgot to add:
  21.  
  22. :  #include <iomanip.h>
  23.  
  24. : >#include <fstream.h>
  25. : >class X:public ifstream{
  26. : >public:
  27. : >   int read();
  28. : >   X(char *s):ifstream(s){;};
  29. : >};
  30.  
  31. : >int X::read(){
  32. : >   int i;
  33. : >   (*this) >> i;               // this is ok
  34. : >   (*this) >> hex >> i;                // compiler does not like this
  35. :                ^^^
  36. : >};
  37.  
  38. : >The error I get is
  39. : >       no match for 'operator >>(class X, enum ios::{anonymous})
  40.  
  41. : Hope this helps  :^)
  42.  
  43. I tried this but it still didn't work. Thanks anyways.
  44.  
  45. --john
  46.  
  47.